import 'dart:io';
import 'package:get/get.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:palmf_hid/common/utils/update_helper.dart';
import 'main_state.dart';

class MainLogic extends GetxController with GetSingleTickerProviderStateMixin {
  final MainState state = MainState();

  @override
  void onReady() {
    super.onReady();
    _checkUpdate();
  }

  //获取版本信息
  void _checkUpdate() {
    if (GetPlatform.isAndroid) {
      PackageInfo.fromPlatform().then((value) {
        UpdateHelper.getSingleton()?.checkUpdate(value.buildNumber, false);
      });
    }
  }
}
